package com.cg.controller;

import com.cg.dto.Result;
import com.cg.dto.ResultUtils;
import com.cg.entity.Divide;
import com.cg.service.DivideService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Divide)表控制层
 *
 * @author chengong
 * @since 2024-01-07 12:36:44
 */
@RestController
@RequestMapping("/divide")
public class DivideController {
    /**
     * 服务对象
     */
    @Resource
    private DivideService divideService;

    /**
     * 根据科室id查询对应的科别信息
     */
    @GetMapping("/queryDivideByDepartmentId")
    public Result<List<Divide>> queryDivideByDepartmentId(@RequestParam("departmentId") Integer departmentId){
        List<Divide> divideList = divideService.queryDivideByDepartmentId(departmentId);
        return ResultUtils.returnDataSuccess(divideList);
    }

}

